import * as THREE from "three"
import Data from "../object/Data"

export default class RaycasterData extends Data {
  hit: RaycastHit
  hits: THREE.Intersection[]
  pointerNdcPosition: THREE.Vector2
  pointerScreenPosition: THREE.Vector2
  pointerOrigin: THREE.Vector3
  pointerDirection: THREE.Vector3
  pointerRay: THREE.Ray
  constructor() {
    super(...arguments)
    this.name = "pointer"
    this.hit = null
    this.hits = []
    this.pointerNdcPosition = new THREE.Vector2()
    this.pointerScreenPosition = new THREE.Vector2()
    this.pointerOrigin = new THREE.Vector3()
    this.pointerDirection = new THREE.Vector3()
    this.pointerRay = new THREE.Ray()
  }
}
export class RaycastHit {
  point: any
  normal: any
  object: any
  intersection: any
  face: { normal: any }
  constructor(point, normal, object, intersection) {
    this.point = point
    this.normal = normal
    this.object = object
    this.intersection = intersection
    this.face = { normal }
  }
}
